Add option for "keep X days of history" 🔼
So I no longer need to log onto those tiny boxes and delete old histories.
reported=2022-10-14 00:45:55
reporter=onefang
priority=urgent
category=Feature
severity=feature
resolution=fixed
2023-05-09 20:32:41 onefang: snork wrote this -
[code=bash]
!/bin/sh 🔼
🔼
2023-04-18 🔼
1. Set $NUMDAYS to the number of days of results you wish to keep. 🔼
Default value is 3, minimum value is 1. 🔼
2. Set $PANOPATH to the location of apt_panopticon files without trailing slash. 🔼
Default value is /var/www/html/apt-panopticon/apt-panopticon. 🔼
3. Run this script daily (probably via cron). Example crontab entry: 🔼
5 1 * * * /var/www/html/apt-panopticon/apt-panopticon/trimresults.sh 🔼
4. If any cron runs are missed, you may have to manually rm the missed entries. 🔼
NUMDAYS=3
PANOPATH="/var/www/html/apt-panopticon/apt-panopticon"
rm -R ${PANOPATH}/results_$(date -d "${NUMDAYS} days ago" "+%Y-%m-%d")*
[/code]
2023-05-11 01:46:41 onefang: Also, to clean up the mess left by failed runs -
[code=bash]
find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "." -type d -print0 | xargs -0 /bin/rm -fr
[/code]
2023-05-11 06:07:43 onefang: Cleaned up a few other things to, didn't use snork's code though.